#pragma once
#include <iostream>
#include <string>

#include "FileSplitter.hpp"

using namespace std;

#define TextBox string

class MainForm : public IProgress
{
private:
    TextBox *m_textFilePath;
    int *m_txtFileNumber;    
    ProgressBar *m_progressBar;

public:
    MainForm(/* args */);
    ~MainForm();

    void Button_1_Click();

    virtual void DoProgress(double value) override;
};

MainForm::MainForm(/* args */)
{
}

MainForm::~MainForm()
{
}

void MainForm::Button_1_Click() 
{
    string filePath = *m_textFilePath;
    int number = *m_txtFileNumber;

    FileSplitter splitter(filePath, number);
    splitter.add_IProgress(this);
    splitter.split();
}

void MainForm::DoProgress(double value)
{
    m_progressBar->setValue(value);
}
